<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:C1.Silverlight.FlexGrid" >

    <!-- brushes -->
    <SolidColorBrush x:Key="_RowBackground" Color="#c0eaeff4" />
    <SolidColorBrush x:Key="_AlternatingRowBackground" Color="#00ffffff" />
    <SolidColorBrush x:Key="_HeaderGridLinesBrush" Color="#e0c8c8c8" />
    <SolidColorBrush x:Key="_GridLinesBrush" Color="#fff0f0f0"/>
    <SolidColorBrush x:Key="_FrozenLinesBrush" Color="#e0000000"/>
    <SolidColorBrush x:Key="_GroupRowBackground" Color="#e0e4e8e4"/>
    <SolidColorBrush x:Key="_CursorBackground" Color="#ffbadde9"/>
    <SolidColorBrush x:Key="_SelectionBackground" Color="#a0badde9"/>

    <Color x:Key="_gradFrom">#f0fafafa</Color>
    <Color x:Key="_gradTo">#f0d7dce1</Color>
    <LinearGradientBrush x:Key="_RowHeaderBackground" EndPoint="1.5,0">
        <GradientStop Color="{StaticResource _gradFrom}" Offset="0" />
        <GradientStop Color="{StaticResource _gradTo}" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="_ColumnHeaderBackground" EndPoint="0,1">
        <GradientStop Color="{StaticResource _gradFrom}" Offset="0" />
        <GradientStop Color="{StaticResource _gradTo}" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="_TopLeftCellBackground" EndPoint="1,1">
        <GradientStop Color="{StaticResource _gradFrom}" Offset="0" />
        <GradientStop Color="{StaticResource _gradTo}" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="_BottomRightCellBackground" EndPoint="1,1">
        <GradientStop Color="{StaticResource _gradTo}" Offset="0" />
        <GradientStop Color="{StaticResource _gradFrom}" Offset="1" />
    </LinearGradientBrush>

    <!-- control definition -->
    <Style TargetType="local:C1FlexGrid">

        <!-- properties -->
        <Setter Property="Background" Value="White" />
        <Setter Property="RowBackground" Value="{StaticResource _RowBackground}"/>
        <Setter Property="AlternatingRowBackground" Value="{StaticResource _AlternatingRowBackground}"/>
        <Setter Property="HeaderGridLinesBrush" Value="{StaticResource _HeaderGridLinesBrush}"/>
        <Setter Property="GridLinesBrush" Value="{StaticResource _GridLinesBrush}"/>
        <Setter Property="FrozenLinesBrush" Value="{StaticResource _FrozenLinesBrush}"/>
        <Setter Property="GroupRowBackground" Value="{StaticResource _GroupRowBackground}"/>
        <Setter Property="CursorBackground" Value="{StaticResource _CursorBackground}"/>
        <Setter Property="SelectionBackground" Value="{StaticResource _SelectionBackground}"/>
        <Setter Property="RowHeaderBackground" Value="{StaticResource _RowHeaderBackground}"/>
        <Setter Property="ColumnHeaderBackground" Value="{StaticResource _ColumnHeaderBackground}"/>
        <Setter Property="TopLeftCellBackground" Value="{StaticResource _TopLeftCellBackground}"/>
        <Setter Property="BottomRightCellBackground" Value="{StaticResource _BottomRightCellBackground}"/>

        <!-- template -->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:C1FlexGrid">
                    <Border Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}" >
                        <!--CornerRadius="2">-->
                        <Grid x:Name="_root" >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <ScrollBar x:Name="_sbV" Orientation="Vertical" Grid.Column="2" Grid.RowSpan="2" />
                            <ScrollBar x:Name="_sbH" Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
